home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / graph-3d.zip / GRAPH12.BAS < prev    next >
BASIC Source File  |  1989-04-23  |  1KB  |  33 lines

  1. 0 dim y(64),z(64):key off:screen 2
  2. 40 cls:locate 10,30:input "Line density (MAX=8)";ld$:ld=val(ld$):if ld=0 then ld=5
  3. 55 locate 12,33:input "Dot density";dd$:dd=val(DD$):if dd=0 then dd=32
  4. 65 locate 14,30:print"Seclect Viewing Angle":print tab(30)"   0 degrees is from overheard":print tab(30)"  90 degrees is from the side"
  5. 66 locate 18,30:input "Angle in degrees";a$:a=val(a$):if a=0 then a=70
  6. 90 a=a*3.14159/180:s=sin(a):c=cos(a):cls
  7. 110 for i=0 to 5*dd
  8. 115 max=-200:min=200:x1=int(25*(-5+i/dd)+.5):x2=-4+i/dd
  9. 120 if i<=2*dd then nl=int(i/dd*4*ld) else nl=8*ld
  10. 125 for j=0 to nl
  11. 130 x=x2-j/4/ld:y=-4+j/ld
  12. 135 gosub 1000:y(j)=y:z(j)=z
  13. 140 gosub 2000:next j
  14. 145 max=-200:min=200:x1=-x1
  15. 150 for j=nl to 0 step -1
  16. 155 y=-y(j):z=z(j)
  17. 160 gosub 2000:next j,i
  18. 175 sound 1000,2:t=timer:while t+1.5>timer:wend
  19. 185 if inkey$="" then 175
  20. 190 locate 25,1:print"Press <R>epeat or <E>xit";
  21. 195 a$=inkey$:if a$="R" or A$="r" then 40 else if a$<>"E" and a$<>"e" then 195
  22. 200 end
  23. 1000 r=sqr(x*x+y*y)
  24. 1010 z=cos(4*r)/(r/2+2)-3*r/8+1
  25. 1020 return
  26. 2000 y=int(30*(c*y+s*z)+.5)
  27. 2005 if m=4 then 2050
  28. 2010 if y<min then min=y else 2050
  29. 2030 pset(320+x1,100-y)
  30. 2050 if y>max then max=y else return
  31. 2070 pset(320+x1,100-y)
  32. 2090 return
  33.